<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>教师风采</title>
	<link rel="stylesheet" href="../css/common2.css">

	<style>
		.two {
			width: 9%;
		}

		.three {
			width: 9%;
		}

		.photo {
			width: 50px;
			height: 50px;
		}
	</style>
</head>

<body>
	<div style="margin-top: 30px;"></div>
	<div id="vue-root">
		<div class="add"><a href="school_teacher_mien_item.html" style="color: white">添加风采</a></div>

		<div class="table">
			<table class="table_top" cellpadding="0" cellspacing="0">
				<thead>
					<tr>
						<th class="one">
							<input type="checkbox" class="check-box" v-model="all">
						</th>
						<th>序号</th>
						<th class="two">姓名</th>
						<th class="two">职称</th>
						<th class="two">头像</th>
						<th class="four">教师简介</th>
						<th class="four">教学经验</th>
						<th class="three">编辑/删除</th>
					</tr>
				</thead>
				<tbody id="list">
					<tr v-for="(teacherMien,index) in list" :key="teacherMien.id">
						<td class="one">
							<input type="checkbox" class="check-box" v-model="teacherMien.checked">
						</td>
						<td><span v-text="index+1"></span> </td>
						<td class="two" v-text="teacherMien.name"></td>
						<td class="two" v-text="teacherMien.level"></td>
						<td class="two"><img :src="img(teacherMien)" class="photo"></td>
						<td class="four" v-text="teacherMien.intro"></td>
						<td class="four" v-text="teacherMien.experience"></td>
						<td class="three">
							<div class="option">
								<div class="edit-icon option-icon" @click="edit(teacherMien.id)"
									style="position: absolute; left: 20%; top: 30%;">
									<img class="img" src="../image/edit.png" height="20" width="20"
										onmouseover="this.src='../image/edit_light.png'"
										onmouseout="this.src='../image/edit.png'" />
								</div>
								<div class="delete-icon option-icon" @click="del([teacherMien.id])"
									style="right: 20%; top:30%;position: absolute;">
									<img class="img" src="../image/delete.png" height="20" width="20"
										onmouseover="this.src='../image/delete_light.png'"
										onmouseout="this.src='../image/delete.png'" />
								</div>
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<br>
		<div class="delete" @click="batchDelete" v-if="total>1">批量删除</div>
		<ul class="pagination" v-if="pages>1">
			<li>
				<a v-if="pageNum!=1" @click="pageNum=1">«</a>
				<a class="pages-jump" v-if="pageNum!=1" @click="pageNum--">‹</a>
				<a v-text="pageNum"></a>
				<a class="pages-jump" v-if="pageNum!=pages" @click="pageNum++">›</a>
				<a v-if="pageNum!=pages" @click="pageNum=pages">»</a>
			</li>
		</ul>

	</div>
	<script src="/scriptZIP/qs.min.js"></script>
	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>
	<script src="/js/common.js"></script>
	<script src="/js/list.js"></script>

	<script>
		var app = new Vue(merge({
			data: {
				urls: {
					del: '/pc/teacherMien/del'
				}
			},
			created: function () {
				var id = top_params().id;
				if (!id) return;
				this.urls.list = '/pc/teacherMien/list/' + id;
				this.getData();
			},
			methods: {
				edit: function (id) {
					location.href = "school_teacher_mien_item.html?id=" + id;
				},
				img: function (teacherMien) {
					if (!teacherMien.pic) return '../image/upload.svg';
					return '/static/' + teacherMien.schoolId + '/teacherMien/' + teacherMien.pic;
				}
			}
		}));
	</script>
</body>

</html>